package com.example.demo.entity.primary;

import javax.persistence.*;

/**
 * Created by dongjunpeng on 2017/10/12.
 */
@Entity
@Table(name = "camera")
public class CameraEntity {
    private int cameraId;
    private String cameraCode;
    private String cameraName;
    private String brand;
    private String model;
    private String protocol;
    private String position;
    private String cameraIpAddress;
    private String cameraPort;
    private String webSocketPort;
    private String username;
    private String password;
    private boolean allowControl;
    private QuayCraneEntity quayCraneByCraneId;

    public CameraEntity() {
    }

    public CameraEntity(String cameraCode, String cameraName, String brand, String model, String protocol, String position, String cameraIpAddress, String cameraPort, String webSocketPort, String username, String password, boolean allowControl, QuayCraneEntity quayCraneByCraneId) {
        this.cameraCode = cameraCode;
        this.cameraName = cameraName;
        this.brand = brand;
        this.model = model;
        this.protocol = protocol;
        this.position = position;
        this.cameraIpAddress = cameraIpAddress;
        this.cameraPort = cameraPort;
        this.webSocketPort = webSocketPort;
        this.username = username;
        this.password = password;
        this.allowControl = allowControl;
        this.quayCraneByCraneId = quayCraneByCraneId;
    }

    @Id
    @Column(name = "camera_id")
    public int getCameraId() {
        return cameraId;
    }

    public void setCameraId(int cameraId) {
        this.cameraId = cameraId;
    }

    @Basic
    @Column(name = "camera_code")
    public String getCameraCode() {
        return cameraCode;
    }

    public void setCameraCode(String cameraCode) {
        this.cameraCode = cameraCode;
    }

    @Basic
    @Column(name = "camera_name")
    public String getCameraName() {
        return cameraName;
    }

    public void setCameraName(String cameraName) {
        this.cameraName = cameraName;
    }

    @Basic
    @Column(name = "brand")
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Basic
    @Column(name = "model")
    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    @Basic
    @Column(name = "protocol")
    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    @Basic
    @Column(name = "position")
    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    @Basic
    @Column(name = "camera_ip_address")
    public String getCameraIpAddress() {
        return cameraIpAddress;
    }

    public void setCameraIpAddress(String cameraIpAddress) {
        this.cameraIpAddress = cameraIpAddress;
    }

    @Basic
    @Column(name = "camera_port")
    public String getCameraPort() {
        return cameraPort;
    }

    public void setCameraPort(String cameraPort) {
        this.cameraPort = cameraPort;
    }

    @Basic
    @Column(name = "web_socket_port")
    public String getWebSocketPort() {
        return webSocketPort;
    }

    public void setWebSocketPort(String webSocketPort) {
        this.webSocketPort = webSocketPort;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "allow_control")
    public boolean getAllowControl() {
        return allowControl;
    }

    public void setAllowControl(boolean allowControl) {
        this.allowControl = allowControl;
    }

    @ManyToOne
    @JoinColumn(name = "crane_id", referencedColumnName = "crane_id", nullable = false)
    public QuayCraneEntity getQuayCraneByCraneId() {
        return quayCraneByCraneId;
    }

    public void setQuayCraneByCraneId(QuayCraneEntity quayCraneByCraneId) {
        this.quayCraneByCraneId = quayCraneByCraneId;
    }
}
